@extends('layouts.default')


@section('title','用户详情')


@section('content')
    <div class="row">
        <div class="offset-md-2 col-md-8">
            <div class="col-md-12">
                <div class="offset-md-2 col-md-8">
                    <h2 class="text-center">{{$user->name}}</h2>
                    <div class="list-group">

                        @foreach($posts as $post)
                            <div class="list-group-item d-flex">
                                <small class="flex-shrink-0 align-self-center">{{$user->name}}</small>
                                <div class="d-flex flex-column flex-grow-1 mx-3">
                                    <h6 class="text-primary">
                                        {{$user->name}}
                                        <small class="text-secondary" style="font-size: 12px">{{$post->created_at->diffForHumans()}}</small>
                                    </h6>
                                    <small style="font-size: 12px">
                                        {{$post->content}}
                                    </small>
                                </div>
                            </div>
                        @endforeach

                    </div>
                    <section class="mt-3">
                        {{$posts->links()}}
                    </section>
                </div>
            </div>
        </div>
    </div>
@endsection
